#include "matrix_formats.h"
#include <stdexcept>
namespace bcpp_matrix
{
using std::string;

//8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888

//	select_matrix_file_format

//8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888

void select_matrix_file_format(const char arg, bcpp_matrix::eMATRIX_IOFORMAT& format, const string& name)
{
	switch (arg)
	 {
		case 'b':
			format= bcpp_matrix::eMIO_BINARY;
			break;
		case 'l':
			format= bcpp_matrix::eMIO_LOWER;
			break;
		case 'p':
			format= bcpp_matrix::eMIO_PAIRS;
			break;
		case 's':
			format= bcpp_matrix::eMIO_SQUARE;
			break;
		case 'y':
			format= bcpp_matrix::eMIO_PHYLIP;
			break;
		case 'w':
			format= bcpp_matrix::eMIO_PHYLIP_NULL;
			break;
		default:
			throw (std::logic_error(
								"The " + name + " data format must be one of \n"
								"\tb    : binary (symmetrical matrix)\n"
								"\tp    : pairs\n"
								"\ts    : square matrix\n"
								"\tl    : lower-triangular"
								"\ty    : square matrix in the PHYLIP style.\n"
								"\tw    : square matrix in the PHYLIP style with zero weighted nulls.\n"));

	 }
}

};



